const { defineConfig } = require('vite');

module.exports = defineConfig({
  server: {
    port: 5173,
    open: true,
    proxy: {
      '/coze': {
        target: 'https://api.coze.cn',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/coze/, ''),
      },
    },
  },
  preview: {
    port: 4173,
    open: true,
  },
  envPrefix: 'VITE_'
});
